package pl.edu.amu.wmi.kino.visualjavafx.model.objects;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;


// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.animationTime.Timeline;
// #[regen=yes,id=DCE.6927C72C-C543-D1CF-B5D4-3EE9509615E3]
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.Opacitable;
// </editor-fold> 
public class Group implements Opacitable,ContentContainer, VisualObject ,java.io.Serializable{

    // Code block for changeListeners support start
    protected PropertyChangeSupport propertySupport= new PropertyChangeSupport(this);
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.addPropertyChangeListener(listener);
    }
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.removePropertyChangeListener(listener);
    }
    // Code block for changeListeners support end

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.09130796-C5E2-B453-369A-60D3631FF6B5]
    // </editor-fold> 
    public Group () {
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.B6AD2191-2DC2-B7DE-9672-180CDDF72F57]
    // </editor-fold> 
    @Override
    public double getHPos () {
        return this.hPos;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.80EDDE54-D07F-1802-4886-E275F0EBBCCA]
    // </editor-fold> 
    @Override
    public void setHPos (double val) {
        double oldVal = this.hPos;
        this.hPos=val;
        propertySupport.firePropertyChange( "hPos" , oldVal, val);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.7229F428-DDF0-C229-9E71-90DF920599C0]
    // </editor-fold> 
    @Override
    public double getVPos () {
        return this.vPos;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.826A8914-CED7-8CD6-D5F8-9B2E49BADED5]
    // </editor-fold> 
    @Override
    public void setVPos (double val) {
        double oldVal = this.vPos;
        this.vPos=val;
        propertySupport.firePropertyChange( "vPos" , oldVal, val);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.EAD23198-2160-E90A-2BA9-59CA130DE395]
    // </editor-fold> 
    @Override
    public double getRotation () {
        return this.rotation;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.AF60D7E2-D441-2E9E-81CD-F469692E73A1]
    // </editor-fold> 
    public void setRotation (double val) {
        double oldVal = this.rotation;
        this.rotation=val;
        propertySupport.firePropertyChange( "rotation" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.744191CD-32D8-1027-91D5-BF34C87A9DB8]
    // </editor-fold> 
    public double getVCenterDelta () {
        return this.vCenterDelta;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.37C2A0CF-79AA-249D-79CF-DC7AE1CA2A5B]
    // </editor-fold> 
    public void setVCenterDelta (double val) {
        double oldVal = this.vCenterDelta;
        this.vCenterDelta=val;
        propertySupport.firePropertyChange( "vCenterDelta" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.DEE05C19-F0F4-E241-1E88-416378937307]
    // </editor-fold> 
    public double getHCenterDelta () {
        return this.hCenterDelta;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.DAA4CA00-A4A6-96F5-931C-A6FDEA6A7A21]
    // </editor-fold> 
    public void setHCenterDelta (double val) {
        double oldVal = this.hCenterDelta;
        this.hCenterDelta=val;
        propertySupport.firePropertyChange( "hCenterDelta" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.D1534205-4E66-59D5-321E-F1C8B4473315]
    // </editor-fold> 
    public double getSizeH () {
        return this.sizeH;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.C039EF6E-1F4B-A30F-FFF1-44BFA6999197]
    // </editor-fold> 
    public void setSizeH (double val) {
        double oldVal = this.sizeH;
        this.sizeH=val;
        propertySupport.firePropertyChange( "hSize" , oldVal, val);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.996CF69E-7F46-C4AE-746A-60EE36C45D3F]
    // </editor-fold> 
    @Override
    public double getSizeV () {
        return this.sizeV;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.C424BC4E-2A5B-19CE-2E7E-F63A59BCD0D3]
    // </editor-fold> 
    public void setSizeV (double val) {
        double oldVal = this.sizeV;
        this.sizeV=val;
        propertySupport.firePropertyChange( "vSize" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.87B7994F-E1D8-4309-7FEF-327BE6491F47]
    // </editor-fold> 
    public ArrayList<VisualObject> getContent () {
        return this.content;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.84FB0B84-09AB-C785-2828-A3FFAA991C79]
    // </editor-fold> 
    public double getHShear () {
        return this.hShear;
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.7BF30D24-FB1B-CB4E-4A36-4743D15CB62D]
    // </editor-fold> 
    public void setHShear (double val) {
        double oldVal = this.hShear;
        this.hShear=val;
        propertySupport.firePropertyChange( "hShear" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.E13D6E28-AFF6-8FD1-F988-5F7DEBCD909A]
    // </editor-fold> 
    public double getVShear () {
        return this.vShear;
     }
     @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.479B9D9D-B447-ED85-EA4B-02B7C57EBE9D]
    // </editor-fold> 
    public void setVShear (double val) {
        double oldVal = this.vShear;
        this.vShear=val;
        propertySupport.firePropertyChange( "vShear" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.90B736E7-F26E-09A4-8387-76454ABE0B4E]
    // </editor-fold> 
    public void setVisibility (boolean val) {
        boolean oldVal = this.visibility;
        this.visibility=val;
        propertySupport.firePropertyChange( "visible" , oldVal, val);
    }
    @Override
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.C79805EF-8C93-8276-04F4-B704DD5FD862]
    // </editor-fold> 
    public boolean getVisibility () {
        return this.visibility;
    }

    @Override
    public Timeline getTimeline() {
        return this.timeline;
    }

    @Override
    public double getOpacity() {
       return this.opacity;
    }

    @Override
    public void setOpacity(double val) {
        double oldVal = this.opacity;
        this.opacity=val;
        propertySupport.firePropertyChange( "opacity" , oldVal, val);
    }

    @Override
    public VisualObject shallowClone(){
        Group res = new Group();
        res.visibility=this.visibility;
        res.vShear=this.vShear;
        res.hShear=this.hShear;
        res.sizeH=this.sizeH;
        res.sizeV=this.sizeV;
        res.vCenterDelta=this.vCenterDelta;
        res.hCenterDelta=this.vCenterDelta;
        res.rotation=this.rotation;
        res.vPos=this.vPos;
        res.hPos=this.hPos;
        res.opacity=this.opacity;
        for(VisualObject o : this.content){
            res.content.add(o.shallowClone());
        }
        return res;
    }

    private boolean visibility=true;
    private double vShear=0.0d;
    private double hShear=0.0d;
    private double sizeH=0.0d;
    private double sizeV=0.0d;
    private double hCenterDelta=0.0d;
    private double vCenterDelta=0.0d;
    private double rotation=0.0d;
    private double hPos=0.0d;
    private double vPos=0.0d;
    private double opacity=1.0d;
    private ArrayList<VisualObject> content=new ArrayList<VisualObject>();
    private Timeline timeline = new Timeline();



}

